#include<bits/stdc++.h>
using namespace std;

int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};

int n, m, sx, sy, fx, fy;
bool vis[10][10];

int ans;

void dfs(int x, int y) {
	if (x == fx && y == fy) {
		ans++;
		return ;
	}

	for (int i = 0; i < 4; i++) {
		int xx = x + dx[i];
		int yy = y + dy[i];
		if (xx < 1 || xx > n || yy < 1 || yy > m || vis[xx][yy])
			continue;
		vis[xx][yy] = 1;
		dfs(xx, yy);
		vis[xx][yy] = 0;
	}
}

signed main() {
	int t;
	cin >> n >> m >> t;
	cin >> sx >> sy >> fx >> fy;
	int x, y;
	while (t--) {
		cin >> x >> y;
		vis[x][y] = 1;
	}

	vis[sx][sy] = 1;
	dfs(sx, sy);
	cout << ans;
	return 0;
}
